﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

namespace GMS
{
    public partial class Pages_Admin_Price : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!SessionVariable.Instance.UserDetails.IsAdmin)
            {
                Response.Redirect("Login.aspx");
            }
        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (!string.IsNullOrWhiteSpace(txtBackSplash.Text) && !string.IsNullOrWhiteSpace(txtSinkCutOut.Text) &&
               !string.IsNullOrWhiteSpace(txtTax.Text))
            {
                int record = Common.AddPrice(Convert.ToInt32(txtBackSplash.Text), Convert.ToInt32(txtSinkCutOut.Text), 
                    Convert.ToInt32(txtTax.Text));
                gvPrice.DataBind();

                txtBackSplash.Text = string.Empty;
                txtSinkCutOut.Text = string.Empty;
                txtTax.Text = string.Empty;
            }
        }
    }
}